# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>

_realname=podman-compose
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=1.3.0
pkgrel=1
pkgdesc="Get and set values in your .env file in local and production servers (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='https://github.com/containers/podman-compose'
msys2_references=(
  'purl: pkg:pypi/podman-compose'
)
license=(spdx:GPL-2.0-or-later)
depends=(
    "${MINGW_PACKAGE_PREFIX}-podman"
    "${MINGW_PACKAGE_PREFIX}-python-dotenv"
    "${MINGW_PACKAGE_PREFIX}-python-yaml"
)
makedepends=(
  "${MINGW_PACKAGE_PREFIX}-python-build"
  "${MINGW_PACKAGE_PREFIX}-python-installer"
  "${MINGW_PACKAGE_PREFIX}-python-setuptools"
)
options=("!strip")
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname/-/_}-${pkgver}.tar.gz")
sha256sums=('e65a70e8fa26bd195d2017ac5893149b40c0df5a0c20d480a338c4f60218b1fa')

build() {
  cp -r "${_realname/-/_}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"
  ${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
}

package() {
  cd "${srcdir}/python-build-${MSYSTEM}"

  MSYS2_ARG_CONV_EXCL="--prefix=" \
    ${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \
    --destdir="${pkgdir}" dist/*.whl

  install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
}
